const Caim = require('../../model/Cami')
module.exports = async (req, res) => {
    let { id } = req.body
    if (!id) {
        res.sendResult(null,400,'请传递卡密ID')
        return
    }
    const findOneCami = await Caim.findOne({ where: { id } })
    if (!findOneCami) {
        res.sendResult(null,400,'卡密不存在')
        return
    }
    const delCaim = await Caim.destroy({ where: { id } })
    if (!delCaim) {
        res.sendResult(null,500,'删除失败！发生未知错误！')
        return
    }
    res.sendResult(null,200,'删除成功！')
}